package utiles;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class convert {
	
	public static void convertir(String nombreIMG) throws IOException{
	String rutaFILE2 = (AppProperties.getProperty("aplicacion", "RUTA_FILE2"));	
	//public static void main(String[] args) throws IOException {	
	//Create file for the source
	//File input = new File("c:/file/"+nombreIMG+".bmp");	
	File input = new File(rutaFILE2+nombreIMG+".bmp");
	
	//Read the file to a BufferedImage
	BufferedImage image = ImageIO.read(input);
	//Create a file for the output
	//File output = new File("c:/file/"+nombreIMG+".jpg");
	File output = new File(rutaFILE2+nombreIMG+".jpg");	
	System.out.println(rutaFILE2+nombreIMG+".jpg");

	//Write the image to the destination as a JPG
	ImageIO.write(image, "jpg", output);
	}

}
